const msg = (title, duration = 1500, mask = false) => {
  return new Promise((resolve) => {
    uni.showToast({
      title: title,
      icon: 'none',
      duration: duration,
      mask: mask,
      success: () => {
        setTimeout(() => {
          resolve('done')
        }, duration)
      }
    });
  })
}

const install = Vue => {
  Vue.prototype.$msg = msg
}

export default {
  install
}
